package com.probiz.estore.customer.service;

import java.util.List;


import com.probiz.estore.common.model.customer.Favorite;
import com.probiz.estore.core.service.GenericManager;

/**
 * Manager interface for Favorite, responsible for business processing, and communicate between web and persistence layer.
 *
 */
public interface FavoriteManager extends GenericManager<Favorite> {
	
	/**
	 * 加入收藏夹
	 * @param appuserId		会员的id
	 * @param itemId		物品的id
	 * @param favoriteType	物品的类型，在Favorite.java有具体定义
	 * @return				true - 成功，false - 重复添加
	 */
	public boolean addFavorite(Integer appuserId, Integer itemId, Short favoriteType);
	
	public boolean addFavoriteProduct(Integer appuserId, Integer itemId);
	
	public boolean deleteFavorite(Integer favoriteId, Integer appuserId);
	
	//删除所有与特定产品相关的收藏
	public void deleteFavoriteProducts(Integer productId);
	
	/**
	 * retrieve list of favorite by appuserId
	 * @param appuserId
	 * @return
	 */
	public List<Favorite> getFavorites(Integer appuserId);
	
	/**
	 * 用户收藏夹
	 * @param appuserId 用户ID
	 * @param maxSize 最大个数
	 * @return
	 */
	public List<Favorite> getFavoritesByCustomer(Integer appuserId, Integer maxSize);
	
	/**
	 * 根据appuserId获取该用户的商品收藏数
	 * @param appuserId
	 * @return
	 */
	public long countCustomerFavorite(Integer appuserId);
}